import request from "@/utils/request";

export const comment = (data: CommentParam) => {
  return request.post("/comment/publish", {
    postId: data.postId,
    commentContent: data.commentContent,
    pId: data.pId,
  });
};

export const getCommentList = (id: number) => {
  return request.get("/comment/list", {
    params: {
      id,
    },
  });

  /* const commentList: CommentData[] = [];
  for (let i = 0; i < 10; i++) {
    commentList.push({
      id: 1,
      name: "星凪",
      avatar: "/logo.png",
      commentContent: "这是一条评论",
      postId: 1,
      commentLikes: 0,
      uId: 36,
      createTime: new Date(),
    });
  }
  return commentList; */
};
